package com.sykj.controller;

import com.sykj.bean.Book;
import com.sykj.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/book")
public class BookController {
	/**
	 * 单表显示图书信息
	 */
	@Autowired
	private BookService bookService;
	
	
	/**
	 * @Author 松哥
	 * @Description //TODO 
	 * @Date 2020/3/20 23:17 
	 * @Param []
	 * @return java.util.List<com.sykj.bean.Book>
	 **/
	
	@RequestMapping("/queryBooks")
	public List<Book> queryBooks(){
		System.out.println("--------");
		List<Book> bookList = bookService.list();
		return bookList;//单表直接用服务层的crud方法
	}
}
